package rpg.console;

public class Command {

    public String name;
    public String help;
    int minParam;
    boolean visible;
    String[] params;

    public Command(String name, String help, int minParam) {
        this(name, help, minParam, true);
    }

    public Command(String name, String help, int minParam, boolean visible) {
        this.name = name;
        this.help = help;
        this.minParam = minParam;
        this.visible = visible;
    }

    public boolean canRun(String[] params) {
        if (params.length < minParam) {
            System.out.println("Nincs elég paraméter!");
            System.out.println(name + ": " + help);
            return false;
        }
        runCommand(params);
        return true;
    }

    public void runCommand(String[] params) {
    }
}
